#include "Terrain.h"
#include <iostream>
#include <GL\glut.h>
using namespace std;

Terrain::Terrain(void)//Constructor
{
	cout << "Terrain Constructor\n";
}

Terrain::~Terrain(void)//Destructor
{
	cout << "Terrain Destructor\n";
}

void Terrain::set_values(int a, int b)
{
	x = a;
	y = b;
}

void Terrain::Draw()
{
	if(ctr>=1.0)
		ctr=0;
	ctr+=0.1;
	cout << "test";
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity (); /* clear the matrix */
	glTranslatef(0.0f,0.0f,0.0f);

	gluLookAt (0.0, 0.0,5.0 , 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);/* viewing transformation */
	
	glScalef (1.0, 2.0, 1.0); /* modeling transformation */

	glColor3f (1, 0, 0);//sets colour out of 100% = 1.0;
	glBegin(GL_TRIANGLE_STRIP);
		glVertex3f(0.2, 0.2, 0.0);// x,y,z ;;;; z stays the same
		glVertex3f(0.8, 0.2, 0.0);
		glVertex3f(0.2, 0.5, 0.0);
		glVertex3f(0.8, 0.5, 0.0);
		glVertex3f(0.2, 0.8, 0.0);
		glVertex3f(0.8, 0.8, 0.0);
	glEnd();

	glColor3f (1.0, 1.0, 1.0);//sets colour out of 100% = 1.0;
	glBegin(GL_LINE_STRIP);
		glVertex3f(0.2, 0.2, 0.0);// x,y,z ;;;; z stays the same
		glVertex3f(0.8, 0.2, 0.0);
		glVertex3f(0.2, 0.5, 0.0);
		glVertex3f(0.8, 0.5, 0.0);
		glVertex3f(0.2, 0.8, 0.0);
		glVertex3f(0.8, 0.8, 0.0);
	glEnd();

}
